package leetcode.bitarithmetic;

public class PowerOfFour342 {
    public static void main(String[] args) {
        for (int i = 0; i <= Integer.MAX_VALUE; i++) {
            System.out.println(i + " : " + new PowerOfFour342().new Solution().isPowerOfFour(i));
        }
    }

    class Solution {
        public boolean isPowerOfFour(int n) {
            return n > 0 && (n & (n - 1)) == 0 && ((n & 0b10101010101010101010101010101010) == 0);
        }
    }
}
